<template>
  <!-- <div class="container">
    <div class="tn-cool-bg-color-4" @click="selectGender('男')">我是男生</div>
    <div class="tn-cool-bg-color-14" @click="selectGender('女')">我是女生</div>
  </div> -->
<div class="cards">
    <div class="card red" @click="selectGender('女')">
        <p class="tip" >我是女生</p>
        <p class="second-text">I am a girl</p>
    </div>
    <div class="card blue" @click="selectGender('男')">
        <p class="tip">我是男生</p>
        <p class="second-text">I am a boy</p>
    </div>
</div>

</template>
<script>
import request from "@/common/request.js"
export default {
  methods: {
    selectGender(sex) {
	  //调用后端接口存储性别
	  let id = sex=='男'?1:0;
	  request.get("friend/wx/auth/selSex/"+id,{}).then(res=>{
	  				console.log("#########")
	  			  let _data = res[1]['data']
	  			  console.log(_data.code)
	  			  if(_data.code == 20000){
	  				  console.log(_data)
	  				  // 跳转到另一个页面
	  				  uni.navigateTo({
	  				    url: '/pages/index'
	  				  });
	  				  }
	  });
      
    }
  }
};
</script>

<style>
.container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
}

.tn-cool-bg-color-4 {
      width: 225px; /* 按钮宽度 */
      height: 225px; /* 按钮高度 */
      border-radius: 50%; /* 使按钮呈现圆形 */
      background-color: #ccc; /* 按钮背景色 */
      display: flex;
      justify-content: center;
      align-items: center;
      cursor: pointer;
	   margin: 20px; /* 按钮之间的间距 */
}
.tn-cool-bg-color-14{
      width: 225px; /* 按钮宽度 */
      height: 225px; /* 按钮高度 */
      border-radius: 50%; /* 使按钮呈现圆形 */
      background-color: #ccc; /* 按钮背景色 */
      display: flex;
      justify-content: center;
      align-items: center;
      cursor: pointer;
	   margin: 20px; /* 按钮之间的间距 */
}

.gender-option:hover {
  background-color: #f0f0f0;
}


.cards {
 display: flex;
 flex-direction: column;
 align-items: center;
 justify-content: center;
 height: 100vh;
  gap: 15px;
}

.cards .red {
  background-color: #f43f5e;
}

.cards .blue {
  background-color: #3b82f6;
}

.cards .green {
  background-color: #22c55e;
}

.cards .card {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  height: 100px;
  width: 250px;
  border-radius: 10px;
  color: white;
  cursor: pointer;
  transition: 400ms;
}

.cards .card p.tip {
  font-size: 1em;
  font-weight: 700;
}

.cards .card p.second-text {
  font-size: .7em;
}

.cards .card:hover {
  transform: scale(1.1, 1.1);
}

.cards:hover > .card:not(:hover) {
  filter: blur(10px);
  transform: scale(0.9, 0.9);
}
</style>
